package com.haiyou.crawler.util;

import lombok.extern.slf4j.Slf4j;

/**
 * 字符串工具类
 *
 * @author root
 * @date 2019-03-09 19:01:19
 */
@Slf4j
public class StringUtil {

    /**
     * 表示对象为空或长度为0的String(空)
     *
     * @param str 字符串
     * @return 返回true/false
     */
    public static boolean isEmpty(String str) {
        return (str == null || "".equals(str));
    }


    public static boolean isCheck(String text) {
        if (!StringUtil.isEmpty(text)) {
            if (text.contains(SteamSpyConstant.BAI_DU)
                    || text.contains(SteamSpyConstant.CLOUD_FLARE)
                    || text.contains(SteamSpyConstant.JAVASCRIPT)) {
                return true;
            }
        }
        return false;
    }

}